package exttable.view;

import utils.Localisation;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: Jan 12, 2010
 * Time: 1:15:05 PM
 * To change this template use File | Settings | File Templates.
 */
public class ViewGroup extends ViewLocales implements ILocalsation {
    private final int groupId;
    private final String groupCode;
    private final String dose;
    private final String variantInvest;
    private final String analysisType;


    public static class Build implements IBuilder {
        private int groupId;
        private String groupCode;
        private String nameRu;
        private String nameKz;
        private String nameEn;
        private String dose;
        private String variantInvest;
        private String analysType;

        public Build groupId(int groupId) {
            this.groupId = groupId;
            return this;
        }

        public Build groupCode(String groupCode) {
            this.groupCode = groupCode;
            return this;
        }

        public Build nameRu(String nr) {
            this.nameRu = nr;
            return this;
        }

        public Build nameEn(String ne) {
            this.nameEn = ne;
            return this;
        }

        public Build nameKz(String nk) {
            this.nameKz = nk;
            return this;
        }

        public Build dose(String dose) {
            this.dose = dose;
            return this;
        }

        public Build variantInvest(String variantInvest) {
            this.variantInvest = variantInvest;
            return this;
        }

        public Build analysType(String analysType) {
            this.analysType = analysType;
            return this;
        }


        public ViewGroup build() {
            return new ViewGroup(this);
        }
    }

    public ViewGroup(Build build) {
        groupId = build.groupId;
        groupCode = build.groupCode;
        setNameRu(build.nameRu);
        setNameEn(build.nameEn);
        setNameKz(build.nameKz);
        dose = build.dose;
        variantInvest = build.variantInvest;
        analysisType = build.analysType;
    }

    public int getGroupId() {
        return groupId;
    }

    @Override
    public String toString() {
        return Localisation.getMsg(this);
    }
}
